package com.xcyy.zjdxmjk.zjdxmjk.service.Imp;

import com.xcyy.zjdxmjk.zjdxmjk.entity.Country;
import com.xcyy.zjdxmjk.zjdxmjk.repository.CountryRepository;
import com.xcyy.zjdxmjk.zjdxmjk.service.CountryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CountryServiceImp implements CountryService {
    @Autowired
    private CountryRepository countryRepository;

    @Override
    public Country save(Country country) {
        return countryRepository.save(country);
    }

    @Override
    public List<Country> findAll() {
        return countryRepository.findAll();
    }

    @Override
    public Object countCountry() {
        return countryRepository.countCountry();
    }

    @Override
    public List<Country> findByCodeStartsWith(String code) {
        return countryRepository.findByCodeStartsWith(code);
    }

    @Override
    public List<Country> findByDept(String dept) {
        return countryRepository.findByDept(dept);
    }

    @Override
    public Country findByCode(String code) {
        return countryRepository.findByCode(code);
    }
}
